#ifndef READ_DATA_H
#define READ_DATA_H
#include <iostream>
#include <sstream>
#include <fstream>
#include <vector>
#include <unistd.h>
#include <dirent.h>
#include <stdlib.h>
#include <stdio.h>
#include <map>
#include <queue>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <unordered_map>

#include <algorithm>

#include <memory>
//#include <opencv2/opencv.hpp>

using namespace std;
namespace sad {
class read_data {
public:
    read_data(const std::string& path);
    
    bool LoadSensorData(const std::string& encoder_file_path, std::unordered_map<std::string, std::string>* time_data_map);

    bool read_only_kaist_data(std::unordered_map<std::string, std::string>& time_encoder_map, 
                              std::unordered_map<std::string, std::string>& time_imu_map,
                              std::unordered_map<std::string, std::string>& time_gps_map, 
                              std::unordered_map<std::string, std::string>& time_vrs_gps_map,
                              std::unordered_map<std::string, std::string>& time_sick_middle_map,
                              std::unordered_map<std::string, std::string>& time_velodyne_left_map);

    double get_origin_timestamp() {
        return origin_timestamp;
    }

private:
    std::string path_;

    std::vector<std::string> split(std::string str, std::string pattern);

    double origin_timestamp;
};
}
#endif


